<?php
class stop {
    function main(&$obHTTP) {
        if ($obHTTP->get('masterpassword')==null) {
            $obHTTP->startHTTP(tpl::getInstance()->render('form',array('message'=>'')))->closeHTTP();        
        } elseif ($obHTTP->get('masterpassword')!=config::getInstance()->get('masterpassword')) {
            $obHTTP->startHTTP(tpl::getInstance()->render('form',array('message'=>'Incorrect masterpassword!')))->closeHTTP();        
        } else {
            $obHTTP->startHTTP('Bye!')->closeHTTP();
            log::raise('Bye...');
            exit();
        }
    }
}
